﻿using Assets.Script.Data.EnemyData;
using Assets.Script.Human.Enemy;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.PlayerLoop;

public class EnemyBuff : BuffBase
{
    EnemyBody enemyBody;
    EnemyData enemyData;
    public EnemyBuff(string name, string describe, bool limitTime_Is, float limitTime_S, EnemyData enemyData = null) : base(name, false, describe, limitTime_S, BuffType.敌人)
    {
        this.enemyData = enemyData;
    }

    public void Start(EnemyBody enemyBody)
    {
        this.enemyBody = enemyBody;
        if (enemyData != null)
        {
            enemyBody.Data.Minus(enemyData) ;
        }
    }

    public override void OnEnd()
    {
        if (enemyBody != null)
        {
            enemyBody.Data.Plus(enemyData) ;
        }
    }
}
